/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package src.engine;


/**
 *
 * @author Owner
 */
public class PICAIUUnitUpdate {

  public static float RUNSPEED = .13f;
  public static float MOVESPEED = .08f;
  public static final int NORMAL = 0;
  public static final int GOPRONE = 1;
  public static final int PRONE = 2;
  public static final int UNPRONE = 3;
  public static final int BLOCKED = 4;
  public static final int SHOOT = 5;
  public static final int SHOOTPRONE = 6;
  public static final int RUN = 7;
  public static final int MOVE = 8;
  public static final int REST = 9;
  
  long id;
  double x, y;
  double tx, ty;
  int status = -1;
  float moveSpeed=0;

  PICAIUUnitUpdate(String message) {
    String[] data = message.split("#");
    //position
      id = Long.parseLong(data[1]);
      status = Integer.parseInt(data[2]);
      x = Double.parseDouble(data[3]);
      y = Double.parseDouble(data[4]);
      tx = Double.parseDouble(data[5]);
      ty = Double.parseDouble(data[6]);
      if(status==RUN){
        moveSpeed=RUNSPEED;
      }else if(status==MOVE){
        moveSpeed=MOVESPEED;
      }
  }
}
